package com.dmm.search.config;


import com.dmm.search.interceptors.UserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MVCConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 把定义的拦截器注入到springMvc的拦截器配置中
        registry.addInterceptor(new UserInterceptor())
                .addPathPatterns("/**");
//                .excludePathPatterns("不需要拦截的路径，一般为登陆请求不需要拦截");
    }
}
